home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib6 / v_08_07 / 8n07115a < prev    next >
Encoding:
Text File  |  1995-11-01  |  386 b   |  18 lines

  1. /* Listing 1 - Sample of Inheritance */
  2.  #define S1_CLASS int x; \
  3.                   int y; \
  4.                   int (*read_x)(); \
  5.                   int (*read_y)();
  6.  
  7.  typedef struct s1 {
  8.     S1_CLASS
  9.  } S1;
  10.  
  11.  #define S2_CLASS  S1_CLASS \
  12.                    int z; \
  13.                    int (*read_z)(); \
  14.                    
  15.  typedef struct s2 {
  16.     S2_CLASS  
  17.  } S2;
  18.